package com.ttl.bc.stock.request2.db;





public class BCStkIssue2DDBO {

/*	public boolean add(ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		
		String user = (String)request.getSession().getAttribute("userName");
		
		BCStkIssue2Form stkIssue2Form = setForm(request);//(BCStkIssue2Form)form;
		
		BCIssueTypeBean issueType = new BCIssueTypeBean();
		issueType.setCode("01");			
		
		BCProjectBean proj = new BCProjectBean();
		proj.setCode(stkIssue2Form.getProjectCode());
							
		BCStkIssue2 issue2 = setBCStkIssue2(stkIssue2Form);
		issue2.setBcIssueTypeBean(issueType);
								
		BCStkIssue2DAO dao = new BCStkIssue2DAO();
		String hql = "FROM BCStkIssue2 WHERE docNo = '"+issue2.getDocNo()+"' ";
		List al = dao.find(hql);
		if(al.size()==0) {
			dao.add(issue2);
		}else {
//			String maxDocNo = CommonUtils.getMaxStkIssueDocNo("DD");
//			issue2.setDocNo(maxDocNo);
//			dao.add(issue2);
		}
		System.out.println(CommonUtils.getDateTimeForStamp()+" #user:"+user+" #use :BCStkIssue2DAO #mode :add "+
				  "#docNo:"+issue2.getDocNo());				
		
		// สร้างรายการใหม่ลงใน table: BCStkIssue 
		BCStkIssueBean issue = setBCStkIssue(request,issue2);
		BCStkIssueDAO dao2 = new BCStkIssueDAO();
		System.out.println("## BCStkIssueDAO status:"+dao2.add(issue));;

		System.out.println(CommonUtils.getDateTimeForStamp()+" #user:"+user+" #use :BCStkIssueDAO #mode :add "+
				  "#docNo:"+issue.getDocNo());
		
		// ใส่ข้อมูล itemCode รายการนั้นใน table: processStock 
		ProcessStockDAO p = new ProcessStockDAO();
    	Iterator it = issue.getBcStkIssueSubs().iterator();
    	
        while(it.hasNext()) {
        	BCStkIssueSubBean sub = (BCStkIssueSubBean)it.next();
        	
        	ProcessStockBean bean = new ProcessStockBean();
        	bean.setItemCode(sub.getItemCode());
        	bean.setDocDate(sub.getDocDate());
        	bean.setProcessFlag(0);
        	bean.setFlowStatus(1);
        	bean.setProcessType(14);
        	bean.setProcessCase(1);// สำหรับ BCStkIssue บันทึกเอกสารให้ =1, ลบเอกสารให้=3
        	
        	p.add(bean);
        	
    		System.out.println(CommonUtils.getDateTimeForStamp()+" #user:"+user+" #use :ProcessStockDAO #mode :add "+
  				  "#docNo:"+issue.getDocNo() + " #item:"+sub.getItemCode());        	
        }		
        
        return true;
		
	}

	private BCStkIssueBean setBCStkIssue(HttpServletRequest request,
			BCStkIssue2 issue2) {
		
		BCStkIssueBean issue = new BCStkIssueBean();
		
		issue.setDocNo(issue2.getDocNo());
		issue.setDocDate(issue2.getDocDate());		
		issue.setDepartCode(issue2.getDepartCode());
		issue.setIssueType(issue2.getIssueType());		
		
		issue.setPersonCode(issue2.getPersonCode());				
		
		issue.setSumOfAmount(new Float(0));
		
		issue.setGlFormat("");
		issue.setGlStartPosting(0);
		
		issue.setIsCompleteSave(1);
		issue.setIsConfirm(0);
		issue.setIsCancel(0);
		
		issue.setProjectCode(issue2.getProjectCode());
		issue.setCreatorCode((String)request.getSession().getAttribute("userName"));				
		issue.setCreateDateTime(new Date());								
		
		HashSet s = new HashSet();		
		
		Iterator it = (issue2.getBcStkIssueSub2s()).iterator();
	    while(it.hasNext()) {
	    	BCStkIssueSub2 sub2 = (BCStkIssueSub2)it.next();
	       	//System.out.println("itemCode = "+sub2.getItemCode());
	    	BCStkIssueSubBean sub = new BCStkIssueSubBean();
//	    	sub.setIssueType(sub2.getIssueType());
	    	sub.setItemCode(sub2.getItemCode());
	    	sub.setDocDate(issue.getDocDate());
	    	sub.setDepartCode(sub2.getDepartCode());
	    	sub.setPersonCode(issue.getPersonCode());
	    	sub.setWhCode(sub2.getWhCode());
	    	sub.setQty(sub2.getQty());
	    	sub.setRetQty(sub2.getRemainQty());
	    	sub.setProjectCode(sub2.getProjectCode());
	    	sub.setLineNumber(sub2.getLineNumber());
	    	sub.setItemName(sub2.getItemName());
	    	
	    	BCItemUnitBean unit = new BCItemUnitBean();
	    	unit.setCode(sub2.getBcitemUnit().getCode());
	    	sub.setBcitemUnit(unit);
	    	
	    	BCShelfBean shelf = new BCShelfBean();
	    	shelf.setCode(sub2.getBcShelf().getCode());
	    	sub.setBcShelf(shelf);
	    	
	    	sub.setBcStkIssue(issue);
	    	
	    	s.add(sub);
	    }		
		issue.setBcStkIssueSubs(s);
		
		return issue;
	}

	private BCStkIssue2 setBCStkIssue2(BCStkIssue2Form stkIssue2Form) {
		
		BCStkIssue2 issue2 = new BCStkIssue2();
		issue2.setProjectCode(stkIssue2Form.getProjectCode());				
		issue2.setIsCancel(0);					
		issue2.setDocNo(stkIssue2Form.getDocNo());
		issue2.setCreatorCode(stkIssue2Form.getPersonCode());
		issue2.setDepartCode(stkIssue2Form.getDepartCode());
        issue2.setDocDate(CommonUtils.convertStringToDate(stkIssue2Form.getDocDate()));
        issue2.setCreateDateTime(new Date());								
		
		issue2.setIsCompleteSave(1);
		issue2.setIssueType(stkIssue2Form.getIssueType());
		issue2.setiTTL_orderNo(stkIssue2Form.getOrderNo());
		issue2.setiTTL_deptPay(stkIssue2Form.getiTTL_deptPay());
		issue2.setPersonCode(stkIssue2Form.getPersonCode());
		issue2.setMyDescription(stkIssue2Form.getMyDescription());
		
		HashSet s = new HashSet();			
		
		int billStatus = 0;
		
		if( stkIssue2Form.getItemCode1() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode1());
			issueSub2.setItemName(stkIssue2Form.getItemName1());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty1()));
			
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty1())-Float.valueOf(stkIssue2Form.getPayQty1());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode1());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(1);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName1());						
			
			issueSub2.setIttl_division(stkIssue2Form.getDivision1());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}
		
		if(stkIssue2Form.getItemCode2() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode2());
			issueSub2.setItemName(stkIssue2Form.getItemName2());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty2()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty2())-Float.valueOf(stkIssue2Form.getPayQty2());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode2());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(2);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName2());
			issueSub2.setIttl_division(stkIssue2Form.getDivision2());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}		
		
		if( stkIssue2Form.getItemCode3() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode3());
			issueSub2.setItemName(stkIssue2Form.getItemName3());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty3()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty3())-Float.valueOf(stkIssue2Form.getPayQty3());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode3());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(3);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName3());
			issueSub2.setIttl_division(stkIssue2Form.getDivision3());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}		
		
		if(stkIssue2Form.getItemCode4() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode4());
			issueSub2.setItemName(stkIssue2Form.getItemName4());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty4()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty4())-Float.valueOf(stkIssue2Form.getPayQty4());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode4());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(4);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName4());
			issueSub2.setIttl_division(stkIssue2Form.getDivision4());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}

		if(stkIssue2Form.getItemCode5() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode5());
			issueSub2.setItemName(stkIssue2Form.getItemName5());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty5()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty5())-Float.valueOf(stkIssue2Form.getPayQty5());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode5());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(5);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName5());
			issueSub2.setIttl_division(stkIssue2Form.getDivision5());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}
		if(stkIssue2Form.getItemCode6() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode6());
			issueSub2.setItemName(stkIssue2Form.getItemName6());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty6()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty6())-Float.valueOf(stkIssue2Form.getPayQty6());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode6());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(6);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName6());
			issueSub2.setIttl_division(stkIssue2Form.getDivision6());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}
		if(stkIssue2Form.getItemCode7() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode7());
			issueSub2.setItemName(stkIssue2Form.getItemName7());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty7()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty7())-Float.valueOf(stkIssue2Form.getPayQty7());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode7());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(7);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName7());
			issueSub2.setIttl_division(stkIssue2Form.getDivision7());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}
		if(stkIssue2Form.getItemCode8() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode8());
			issueSub2.setItemName(stkIssue2Form.getItemName8());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty8()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty8())-Float.valueOf(stkIssue2Form.getPayQty8());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode1());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(8);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName8());
			issueSub2.setIttl_division(stkIssue2Form.getDivision8());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}
		if(stkIssue2Form.getItemCode6() != null) {
			BCStkIssueSub2 issueSub2 = new BCStkIssueSub2();
			
			issueSub2.setDepartCode(stkIssue2Form.getDepartCode());
			issueSub2.setDocDate(new Date());
			issueSub2.setIssueType(stkIssue2Form.getIssueType());				
			issueSub2.setItemCode(stkIssue2Form.getItemCode9());
			issueSub2.setItemName(stkIssue2Form.getItemName9());
			issueSub2.setQty(Float.valueOf(stkIssue2Form.getQty9()));
			
			float remainQty = Float.valueOf(stkIssue2Form.getQty9())-Float.valueOf(stkIssue2Form.getPayQty9());
			if(remainQty==0) {
				billStatus = 1;
			}else {
				billStatus = 2;
			}
			issueSub2.setRemainQty(remainQty);
			
			BCItemUnitBean itemU = new BCItemUnitBean();
			itemU.setCode(stkIssue2Form.getUnitCode9());
			issueSub2.setBcitemUnit(itemU);				
			issueSub2.setWhCode("10");
			
			issueSub2.setLineNumber(9);
			issueSub2.setIttl_unitName(stkIssue2Form.getUnitName9());
			issueSub2.setIttl_division(stkIssue2Form.getDivision9());								
			
			BCShelfBean shelf = new BCShelfBean();
			shelf.setCode("31");
			issueSub2.setBcShelf(shelf);				
			issueSub2.setBcStkIssue2(issue2);
			
			issueSub2.setPersonCode(stkIssue2Form.getPersonCode());
			issueSub2.setProjectCode(stkIssue2Form.getProjectCode());
			issueSub2.setCreatorCode(stkIssue2Form.getPersonCode());
			issueSub2.setCreateDateTime(issue2.getCreateDateTime());
			
			s.add(issueSub2);
		}
		
		issue2.setBillStatus(billStatus);// ถ้าเบิกหมด billstatus = 1, เบิกไม่หมด billStatus =2, ยังไม่เบิก = 0
		issue2.setBcStkIssueSub2s(s);
		
		return issue2;
	}

	private BCStkIssue2Form setForm(HttpServletRequest request) {
		BCStkIssue2Form stkIssue2Form = new BCStkIssue2Form();
		
		stkIssue2Form.setDocNo(request.getParameter("docNo"));
		stkIssue2Form.setDocDate(request.getParameter("docDate"));				
		
		stkIssue2Form.setProjectCode(request.getParameter("projectCode"));
		stkIssue2Form.setPersonCode(request.getParameter("personCode"));
		
		stkIssue2Form.setiTTL_deptPay(request.getParameter("iTTL_deptPay"));
		try {			
			stkIssue2Form.setMyDescription(new String((""+request.getParameter("myDescription")).getBytes("ISO8859_1"),"UTF-8"));
		} catch(Exception ex){}
		try {		
			stkIssue2Form.setItemName1(new String((""+request.getParameter("itemName1")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName1(new String((""+request.getParameter("unitName1")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision1(new String((""+request.getParameter("division1")).getBytes("ISO8859_1"),"UTF-8"));						
		} catch(Exception ex){}
		try {	
			stkIssue2Form.setItemName2(new String((""+request.getParameter("itemName2")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName2(new String((""+request.getParameter("unitName2")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision2(new String((""+request.getParameter("division2")).getBytes("ISO8859_1"),"UTF-8"));
		} catch(Exception ex){}
		try {	
			stkIssue2Form.setItemName3(new String((""+request.getParameter("itemName3")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName3(new String((""+request.getParameter("unitName3")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision3(new String((""+request.getParameter("division3")).getBytes("ISO8859_1"),"UTF-8"));
		} catch(Exception ex){}
		try {	
			stkIssue2Form.setItemName4(new String((""+request.getParameter("itemName4")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName4(new String((""+request.getParameter("unitName4")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision4(new String((""+request.getParameter("division4")).getBytes("ISO8859_1"),"UTF-8"));
		} catch(Exception ex){}
		try {	
			stkIssue2Form.setItemName5(new String((""+request.getParameter("itemName5")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName5(new String((""+request.getParameter("unitName5")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision5(new String((""+request.getParameter("division5")).getBytes("ISO8859_1"),"UTF-8"));			
		} catch(Exception ex){}
		try {
			stkIssue2Form.setItemName6(new String((""+request.getParameter("itemName6")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName6(new String((""+request.getParameter("unitName6")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision6(new String((""+request.getParameter("division6")).getBytes("ISO8859_1"),"UTF-8"));
		} catch(Exception ex){}
		try {	
			stkIssue2Form.setItemName7(new String((""+request.getParameter("itemName7")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName7(new String((""+request.getParameter("unitName7")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision7(new String((""+request.getParameter("division7")).getBytes("ISO8859_1"),"UTF-8"));
		} catch(Exception ex){}
		try {	
			stkIssue2Form.setItemName8(new String((""+request.getParameter("itemName8")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName8(new String((""+request.getParameter("unitName8")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision8(new String((""+request.getParameter("division8")).getBytes("ISO8859_1"),"UTF-8"));
		} catch(Exception ex){}
		try {	
			stkIssue2Form.setItemName9(new String((""+request.getParameter("itemName9")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setUnitName9(new String((""+request.getParameter("unitName9")).getBytes("ISO8859_1"),"UTF-8"));
			stkIssue2Form.setDivision9(new String((""+request.getParameter("division9")).getBytes("ISO8859_1"),"UTF-8"));			
		}catch (Exception e) {
			System.out.println("############ error #########\n"+e.toString());
		}				
		
		stkIssue2Form.setDepartCode(request.getParameter("departCode"))	;						
		stkIssue2Form.setIssueType(request.getParameter("issueType"));
		
		stkIssue2Form.setItemCode1(request.getParameter("itemCode1"));			
		stkIssue2Form.setUnitCode1(request.getParameter("unitCode1"));				
		
		stkIssue2Form.setQty1(request.getParameter("qty1"));
		stkIssue2Form.setPayQty1(request.getParameter("payQty1"));
						
		stkIssue2Form.setItemCode2(request.getParameter("itemCode2"));		
		stkIssue2Form.setUnitCode2(request.getParameter("unitCode2"));
		stkIssue2Form.setQty2(request.getParameter("qty2"));				
		stkIssue2Form.setPayQty2(request.getParameter("payQty2"));
		
		stkIssue2Form.setItemCode3(request.getParameter("itemCode3"));		
		stkIssue2Form.setUnitCode3(request.getParameter("unitCode3"));
		stkIssue2Form.setQty3(request.getParameter("qty3"));		
		stkIssue2Form.setPayQty3(request.getParameter("payQty3"));
								
		stkIssue2Form.setItemCode4(request.getParameter("itemCode4"));
		stkIssue2Form.setUnitCode4(request.getParameter("unitCode4"));
		stkIssue2Form.setQty4(request.getParameter("qty4"));													
		stkIssue2Form.setPayQty4(request.getParameter("payQty4"));
				
		
		stkIssue2Form.setItemCode5(request.getParameter("itemCode5"));
		stkIssue2Form.setUnitCode5(request.getParameter("unitCode5"));
		stkIssue2Form.setQty5(request.getParameter("qty5"));													
		stkIssue2Form.setPayQty5(request.getParameter("payQty5"));
		
		
		stkIssue2Form.setItemCode6(request.getParameter("itemCode6"));
		stkIssue2Form.setUnitCode6(request.getParameter("unitCode6"));
		stkIssue2Form.setQty6(request.getParameter("qty6"));													
		stkIssue2Form.setPayQty6(request.getParameter("payQty6"));		
		
		stkIssue2Form.setItemCode7(request.getParameter("itemCode7"));
		stkIssue2Form.setUnitCode7(request.getParameter("unitCode7"));
		stkIssue2Form.setQty7(request.getParameter("qty7"));													
		stkIssue2Form.setPayQty7(request.getParameter("payQty7"));
				
		stkIssue2Form.setItemCode8(request.getParameter("itemCode8"));
		stkIssue2Form.setUnitCode8(request.getParameter("unitCode8"));
		stkIssue2Form.setQty8(request.getParameter("qty8"));													
		stkIssue2Form.setPayQty8(request.getParameter("payQty8"));
		
		stkIssue2Form.setItemCode9(request.getParameter("itemCode9"));
		stkIssue2Form.setUnitCode9(request.getParameter("unitCode9"));
		stkIssue2Form.setQty9(request.getParameter("qty9"));													
		stkIssue2Form.setPayQty9(request.getParameter("payQty9"));
		
		return stkIssue2Form;
	}
*/}
